
	let oInput = document.querySelector(".buttontwo");
	let oinputone=document.querySelector(".inputone")
	let oinputtwo=document.querySelector(".inputtwo")
	oInput.onclick = function(){
		let xhr = new XMLHttpRequest();
		xhr.open("post","2denglu.php",true);
		//1.设置请求头
		//将数据参数以form表单的形式发送
		xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		//2.将键值对参数写入至send
		//key1=value1&key2=value2...
		
		
		// "userId="+this.value
		// "usePassword="+this.value
		
		xhr.send("userId="+oinputone.value+"&"+"usePassword="+oinputtwo.value);
		xhr.onreadystatechange = function(){
			if(xhr.status==200 && xhr.readyState==4){
				
				fun(xhr.responseText);
			}
		}
	}

	function fun(resText){
		let oSpan = document.querySelector("#span");
		//前后端分离
		if(resText == "1"){
			oSpan.innerHTML = "登陆";
			location.href="index.html"
		}else if(resText == "0"){
			oSpan.innerHTML = "账号错误";
		}
	}
